import {connect} from 'react-redux'
import {setVisibilityFilter} from "../Action/ActionTypes";
import Link from '../Components/Link'

const mapStateToProps = (state,ownProps)=>({
    active: state.visibilityFilter === ownProps.filter
})

const mapDispatchToProps = (dispatch,ownProps)=>{
    return {
        onClick: ()=>dispatch(setVisibilityFilter(ownProps.filter))
    }
}

export default connect(
    mapStateToProps,
    mapDispatchToProps
)(Link)